Forgetting to do so was causing the Wayland im context
to leave behind a dead event controller. This was showing
up as a crash when closing the inspector after changing
the im-module property of a GtkText widget. The crash
was delayed until closing the inspector because the
inspector keeps a ref on the event controllers of the
currently shown widget.
gtk_im_multicontext_delete_surrounding_cb,
multicontext);
+ if (priv->client_widget)
+ gtk_im_context_set_client_widget (priv->delegate, NULL);
+
g_object_unref (priv->delegate);
priv->delegate = NULL;